

<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*, java.sql.*, connection.*"%>
<%
/* 
<td >
<input type="text" name="name" value=""></td>
<td ><input type="text" name="latitude" value=""></td>
		  <td ><input type="text" name="longitude" value=""></td>
		  <td ><input type="text" name="description" value=""></td>
		  */
	Connection conn = new DbConnection().getConn();
	String id = request.getParameter("id");
	String text = request.getParameter("text");
	
	String sql = "DELETE FROM Question WHERE questionid="+id;

	System.out.println("SQL: "+sql);
	if(sql != null){
		try{
			PreparedStatement ps = conn.prepareStatement(sql);
			ps.executeQuery();
			response.sendRedirect("Addquestion.jsp?deletefail=false&deltext="+text);
		}catch(SQLException e){
			System.out.println(e);
			response.sendRedirect("Addquestion.jsp?deletefail=true");
		}
	}
	%>